#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#ifndef UNICODE
#define UNICODE
#endif

#ifndef _UNICODE
#define _UNICODE
#endif

#define _WIN32_WINNT 0x0500
#define WINVER       0x0500

#define _WIN32_DCOM
#include <QMainWindow>
#include <QDebug>
#include <Windows.h>
#include <SoftPub.h>
#include <wincrypt.h>
#include <stdlib.h>
#include <tchar.h>
#include <comdef.h>
#include <vector>
#include <taskschd.h>
#include <QFileInfo>
#pragma comment(lib, "Crypt32.lib")
#pragma comment(lib, "Wintrust.lib")
#pragma comment (lib, "taskschd.lib")
#pragma comment (lib, "comsupp.lib")
#pragma comment (lib,"Advapi32.lib")


namespace Ui {
class MainWindow;
}

class scheduledTaskInfo
{
public:
    wchar_t name[256] = { 0 };
    wchar_t description[256] = { 0 };
    wchar_t author[256] = { 0 };
    TASK_STATE status;
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:

    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void viaFolderPath();
    void viaFolderPathUser(int &);
    void viaFolderPathSys(int &);
    void traversePathUni(const TCHAR* const,int &);


    void viaRegistry();
    void viaRegistry1st(int &);  //HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    void viaRegistry2nd(int &);
    void viaRegistry3rd(int &);
    void viaRegistry4th(int &);
    void viaRegistry5th(int &);
    void viaRegistry6th(int &);
    void viaRegistry7th(int &);
    void viaRegistry8th(int &);
    void viaRegistry9th(int &);
    void traverseRegistryUni(const HKEY,const WCHAR* const,int &);

    void viaDrivers();
    void viaServices();
    void viaScheduledTasks();

    //extended
    void viaImageHijack();
    void viaKnownDlls();

    //通过文件夹路径，访问文件
    QString purePath(const QString);
    QString gotoSingleFileTime(const QString);

    //通过数字签名证书，获得发布者名称，以及数字签名
    LPTSTR GetCertificateDescription(PCCERT_CONTEXT pCertCtx);
    void testCert();
    QString publisherName(const QString);

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
